package com.cskaoyan.javase.oop1._3memory;

/**
 * 创建两个对象
 * 画出它们的内存图
 *
 * @since 16:22
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        Teacher t = new Teacher();
        Teacher t2 = t;
        Teacher t3 = new Teacher();
        System.out.println(t == t2);
        System.out.println(t == t3);
        t.salary = 100000;
        System.out.println(t2.salary);
        System.out.println(t3.salary);
    }
}

class Teacher {
    double salary;
    public void teach(){
        System.out.println("上课!");
    }
}